package com.awspaas.user.apps.processforsap.event;

import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener;
import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListenerInterface;
import com.actionsoft.sdk.local.SDK;

/**
 * 初始数据，给接口赋值
 */
public class InitialDataForSD003 extends ExecuteListener implements ExecuteListenerInterface {
    @Override
    public void execute(ProcessExecutionContext ctx) throws Exception {
        BO bo = ctx.getBO("BO_EU_SAPSD_KHSWXGXYPS");

        //S4
        BO bo1 = new BO();
        bo1.set("LIMIT_RULE","STANDARD");
        bo1.set("RISK_CLASS","0");
        bo1.set("CHECK_RULE","01");
        bo1.set("SEGMENT","FHEC");
        bo1.set("X_LIMIT_IS_SET","X");
        bo1.set("CREDIT_LIMIT",bo.getString("FIELD0021"));
        SDK.getBOAPI().create("BO_EU_SAPSD_KHXZ_04",bo1,bo.getBindId(),ctx.getUserContext().getUID());

        //S5

        BO bo11 = new BO();
        bo11.set("PARVW","Z1");
        bo11.set("KTONR",bo.getString("KHBM"));
        SDK.getBOAPI().create("BO_EU_SAPSD_KHXZ_03",bo11,bo.getBindId(),ctx.getUserContext().getUID());



        BO bo33 = new BO();
        bo33.set("PARVW","Z3");
        bo33.set("KTONR",bo.getString("CREATEUSER"));
        SDK.getBOAPI().create("BO_EU_SAPSD_KHXZ_03",bo33,bo.getBindId(),ctx.getUserContext().getUID());



        BO bo44 = new BO();
        bo44.set("PARVW","Z4");
        bo44.set("KTONR",bo.getString("FIELD0028"));
        SDK.getBOAPI().create("BO_EU_SAPSD_KHXZ_03",bo44,bo.getBindId(),ctx.getUserContext().getUID());

    }
}
